package com.ext.aic.box;

import com.eyinfo.mpkv.MPLocalKV;

public class AccessibilityManager {
    private static volatile AccessibilityManager instance;

    public static AccessibilityManager getInstance() {
        if (instance == null) {
            synchronized (AccessibilityManager.class) {
                if (instance == null) {
                    instance = new AccessibilityManager();
                }
            }
        }
        return instance;
    }

    private boolean isRunning;

    public boolean isRunning() {
        if (!isRunning) {
            isRunning = MPLocalKV.getInstance().getBoolean(Keys.RUNNING_STATUS_KEY, false);
        }
        return isRunning;
    }

    public void setRunning(boolean running) {
        isRunning = running;
        MPLocalKV.getInstance().put(Keys.RUNNING_STATUS_KEY, running);
    }
}
